<div class="payments_with_credit">
<div class="grid_table">
  <table cellpadding="0" cellspacing="0">
    <colgroup>
      <col class="one"/>
      <col class="two"/>
      <col class="three"/>
      <col class="four"/>
      <col class="five"/>
      <col class="six"/>
    </colgroup>
    <thead>
    <tr>
      <th class="align_center"><%= t('invoice') %> #</th>
      <th class="align_left"><%= t('client') %></th>
      <th class="align_center"><%= t('views.common.type') %></th>
      <th class="align_center"><%= t('views.common.notes') %></th>
      <th class="align_center"><%= t('views.common.date') %></th>
      <th class="align_right"><%= t('amount') %></th>
    </tr>
    </thead>
    <%= hidden_field_tag 'per', params[:per] %>
    <tbody id="payment_body">
    <% @payments_with_credit.each do |payment| %>
        <tr>
          <td class="align_center"><%= payment.payment_reference rescue "" %></td>
          <td class="align_left text-overflow-class"><%= payment.client_name %></td>
          <td class="align_center"><%= (payment.payment_method || payment.payment_type || "").capitalize %></td>
          <td class="align_left"><%= payment.notes %></td>
          <td class="align_center"><%= payment.payment_date %></td>
          <td class="align_right payment_amount"><%= content_tag(:span, '* ') if payment.payment_method == "Credit" %><%= "#{payment.invoice.present??  number_to_currency(payment.payment_amount, unit: payment.invoice.currency.present? ? payment.invoice.currency.unit : "$") : number_to_currency(payment.payment_amount)}" %></td>
        </tr>
    <% end %>
    </tbody>
  </table>
</div>
</div><!--payments_with_credit-->